<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath %>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>农资与农产品全程供应链物流平台-新增仓库</title>
<meta name="kewywords" content="农资与农产品全程供应链物流平台"/>
<meta name="description" content="农资与农产品全程供应链物流平台"/>
<link href="css/style.css" type="text/css" rel="stylesheet"/>
<link type="text/css" rel="stylesheet" href="css/jquery-ui.css" />	
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
		<script type="text/javascript">
		$(document).ready(function(){
			if($("#selectIds").val() != "" ){
			//alert($("#selectIds").val());
				var selectIds = $("#selectIds").val().split(",");					
				if(selectIds[0] == 0){
					$("#male").click();
				}else if(selectIds[0] == 1){
					$("#female").click();
				}	
				// 选中驾照类型
				//alert(selectIds[1]);
				setSelectedValue("licenseType",selectIds[1]);					
				//alert(selectIds[2]);
				// 选中司机状态
				setSelectedValue("state",selectIds[2]);
			}

			var birthday = $("#birthday").val();
			var validFrom = $("#validFrom").val();	
			$("#validFromDate").val(validFrom);
			$("#birthDate").val(birthday);
		});
		function setSelectedValue(id,value){
			//alert(id + value);
			var obj = document.getElementById(id);
			//alert(obj);
				for( i = 0;obj.options.length > i; i++){
					if(obj.options[i].value == value){
						obj.options[i].selected = true;
						return;
					}
				}
		}
		$(function(){
			$("#validFromDate").datepicker({					
				changeMonth: true,
      			changeYear: true,
      			dateFormat: "yy-mm-dd",
      			showButtonPanel: true,
      			yearRange: "2008:2013",
      			closeText: "Close",
      			currentText: "Now" //,
      			//monthNames:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]     			
			});
			$("#birthDate").datepicker({					
				changeMonth: true,
      			changeYear: true,
      			dateFormat: "yy-mm-dd",
      			yearRange: "1950:2012",
      			closeText: "Close",
      			currentText: "Now" //,
      			//monthNames:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]
			});	
		});	
		function saveCheck(){
			if($("#driver").val() == ""){
				alert("姓名不能为空");
				return false;
			}
			if($("#idCardNo").val() == ""){
				alert("身份证号码不能为空");
				return false;
			}
			if($("#telephone").val() == ""){
				alert("请填写手机号码");
				return false;
			}else if($("#telephone").val() != ""){
				var phone = $("#telephone").val();
				//alert(phone);
				if($.trim(phone).length > 11 || 11 > $.trim(phone).length){
					alert("请输入11位手机号码");
					return false;
				}else if(!Check_Mobiles(phone)){
					alert("请输入正确的手机号码");
					return false;
				}					
			}
			if($("#birthDate").val() == ""){
				alert("出生日期不能为空");
				return false;
			}
			if($("#address").val() == ""){
				alert("地址不能为空");
				return false;
			}
			if($("#validFromDate").val() == ""){
				alert("驾照有效起始日期不能为空");
				return false;
			}
			if($("#validPeriod").val() == ""){
				alert("驾照有效期限不能为空");
				return false;
			}
			$("#birthday1").val($("#birthDate").val());
			$("#validFrom1").val($("#validFromDate").val());
			$("#driverInfo").submit();
		}			
		</script>
</head>
<body>
<%@include file="top.jsp" %>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="187" height="37" bgcolor="#e0e0e0" class="brt bbt"><div class="topleft fl">系统菜单栏</div></td>
    <td bgcolor="#e7e7e7" class=" bbt"><div class="topleft fl">您现在的位置：<a href="#">首页</a>&nbsp;>&nbsp;<span>新增仓库</span></div></td>
  </tr>
  <tr>
    <td width="187" height="100%" valign="top" bgcolor="#FFFFFF" class="brt"><div class="left_bk"> 
         <ul>
           <div class="menu2">
          <%@include file="repertory_left.jsp" %>
        
        </div></td>
    <td align="left" valign="top" bgcolor="#FFFFFF"><div class="content">
      <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td height="38" style="background:url(images/zz_tit.jpg) left top repeat-x;"><div class="tt_back fl">新增仓库</div><div class="fr"><img src="images/tit_right.jpg" alt="" width="103" height="38" /></div></td>
        </tr>
        <tr>
          <td class="borders btn"><table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td bgcolor="#fffeee" style="border-bottom:#fee7bd solid 1px;" >
    	<form action="saveDriver" method="post" id="driverInfo">
				  	<s:hidden name="selectIds" id="selectIds" />
				  	<s:hidden name="birthday" id="birthday"/>
				  	<s:hidden name="validFrom" id="validFrom"/>
				  		<input type="hidden" name="birthday1" id="birthday1" value=""/>
				  	<input type="hidden" name="validFrom1" id="validFrom1" value=""/>
    <table border="0" cellspacing="0" cellpadding="0" align="left" style="margin-top:20px;margin-left: 100px;margin-bottom: 20px; " >
                          <tr style="height: 40px;">
				  			<td align="right" width="100px;">仓库编号：</td>
				  			<td  width="180px;"><input type="text" style="width: 200px;"  class="input_are w122" id="driver" name="driver.driver" value="${driver.driver}"/></td>
				  			
				  		</tr>
				  		<tr style="height: 40px;">
				  			<td align="right">仓库名称：</td>
				  			<td width="180px;">
				  			<input type="text" style="width: 200px;" class="input_are w122" id="driver" name="driver.driver" value="${driver.driver}"/>
				  			</td>
				  		</tr>
				  		<tr style="height: 40px;">
				  			<td align="right">仓库类型：</td>
				  			<td width="180px;"><input type="text" style="width: 200px;"   id="" class="input_are w122"/></td>
				  		</tr>
				  		<tr style="height: 40px;">
				  			<td align="right">备注信息：</td>
				  			<td width="180px;">
				  			<input type="text"  id="" style="width: 200px;"  class="input_are w122"/>
				  			</td>
				  		</tr>
				  		<tr style="height: 40px;">
				  			<td colspan="2" align="center">
				  			<input type="button" style="cursor: pointer;" class="buttons" value="保  存" onclick="saveCheck()">&nbsp;&nbsp;&nbsp;
				  			<input type="reset" style="cursor: pointer;" class="buttons" value="重  置">
				  			</td>
				  		</tr>
</table>
</form>
</td>
  </tr>
    </table></td>
  </tr>
</table>
</td>
        </tr>
      </table>
    </div></td>
  </tr>
</table>
<div class="bottom">版权所有：安徽朗坤物联网</div>
</body>
</html>